﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Pointandclick.ScreenManagement
{
    class ExitPopUp : TwoButtonPopUp
    {
        public ExitPopUp(ScreenManager manager)
        {
            this.Manager = manager;
            Title = "Sair do Jogo?";
            LoadContent();
            Confirm = "Sair";
            Cancel = "Cancelar";
            MakeOptionsList();
        }

        protected override void LoadContent()
        {
            Background = Manager.Content.Load<Texture2D>("popUpBg");
            Font = Manager.Content.Load<SpriteFont>("testFont");
        }

        public override void Update(GameTime gameTime)
        {
            foreach (MenuElement option in Options)
                if (option.ClickedOn())
                {
                    if (option.Label == Confirm)
                        Manager.ExitGame();
                    else
                        Manager.PopUp(null);
                }
        }


    }
}
